    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */



import java.awt.Color;
import java.util.ArrayList;

    /**
     *
     * @author theevilelephant
     */
    public class Line {

private int length;
private char line[];
private int pointer;
private Color c = null;

    public Line(String line){
        pointer = 0;
        this.line = new char[line.length()];
        for( int i = 0; i < line.length(); i++ ){
            this.line[i] = line.charAt(i);
        }
        length = line.length();
    }

    public char getChar(int i){
        return line[i];
    }

    public String getString(){
        String ret = "";
        for(int i = 0; i < length; i++){
            ret +=line[i];
        }

        return ret;
    }
    public void setPointer(int p){
        pointer = p;
        if(pointer < 0){
            pointer = 0;
        }
        if(pointer > length){
            pointer = length;
        }
    }

    public int getLength(){
        return length;
    }

    public char getNext(){
        if(pointer < length-1){
            pointer++;
        }

        return line[pointer];
   }

    public char getPrev(){
        if(pointer > 0){
            pointer--;
        }

        return line[pointer];
        
    }

    public Color getColor(){
        return c;
    }

    public void setColor(Color c){
        this.c = c;
    }

    @Override
    public String toString(){
        return "I am a line";
    }
}
